package com.example.writting.data

import android.content.Context
import android.util.Log
import com.example.writting.data.cases.Case1
import org.json.JSONObject

class CaseDataManager(private val context: Context) {
    private val tag = "CaseDataManager"
    private val cases = mapOf(
        "case1" to Case1.data
    )

    fun getCaseData(caseId: String): JSONObject? {
        return try {
            cases[caseId]
        } catch (e: Exception) {
            Log.e(tag, "Error getting case data", e)
            null
        }
    }

    fun getAllCaseIds(): List<String> {
        return cases.keys.toList()
    }

    companion object {
        fun getCaseById(id: String): JSONObject? {
            return when (id) {
                "1" -> Case1.data
                else -> null
            }
        }

        fun getAllCases(): List<JSONObject> {
            return listOf(Case1.data)
        }
    }
} 